package com.dimples.dd.common.annotation;

import com.dimples.dd.common.validator.MobileValidator;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.ElementType;
import java.lang.annotation.Target;

/**
 * 电话验证注解
 *
 * @author zhongyj <1126834403@qq.com><br/>
 * @date 2024/6/21
 */
@Target({
        ElementType.METHOD,
        ElementType.FIELD,
        ElementType.ANNOTATION_TYPE,
        ElementType.CONSTRUCTOR,
        ElementType.PARAMETER,
        ElementType.TYPE_USE
})
@Constraint(validatedBy = MobileValidator.class)
public @interface IsMobile {

    String message() default "手机号格式不正确";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
